
package cn.bluethink.eguan.model.core;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import cn.bluethink.eguan.utils.DateTimeSerializer;

/**
 * @title 通用商品或物品对象
 * @Copyright 苏州中科蓝迪公司所有(c)2016-2021
 * @version 0.1
 *
 * @note 修订历史： （1）liuxn于2018年8月14日构建初始版本0.1
 *               2.wanglei于2018/11/26增加兑换商品的状态
 *               3.wanglei于2018/11/26增加账户信息、包裹
 *               4.wanglei于2018/11/30去除账户信息
 */
public class EgGoods extends EgObject {

	/**
	 * 商品图标
	 */
	private String icon;

	/**
	 * 商品价格，价格为0表示是物品
	 */
	private Integer price;

	/**
	 * 商品数量
	 */
	private Integer number;
	
	/**
     * 商品剩余数量(查询兑换商品不返回)
     */
	@JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer remain;
	
	/**
	 * 包裹
	 */
	private EgBag bag;
	
	/**
	 * 商品的所有者（ID和OTYPE）必须指定
	 * 可以是神秘商人、用户或驿馆
	 */
	private EgObject owner;
	
	/**
	 * 商品更新时间
	 */
    @JsonSerialize(using = DateTimeSerializer.class)
	private Date utime;
	
	/**
     * 兑换商品的状态（0-未派发，1-已派发），如果是商品,不返回
     */
	@JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer status = null;

	public EgGoods() {
		this.setType(new EgOType(EgOType.GOODS,null));
	}

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Integer getRemain() {
        return remain;
    }

    public void setRemain(Integer remain) {
        this.remain = remain;
    }

    public EgBag getBag() {
        return bag;
    }

    public void setBag(EgBag bag) {
        this.bag = bag;
    }

    public EgObject getOwner() {
        return owner;
    }

    public void setOwner(EgObject owner) {
        this.owner = owner;
    }

    public Date getUtime() {
        return utime;
    }

    public void setUtime(Date utime) {
        this.utime = utime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

}
